<template>
    <div class="page-home">
        <home-refresh @refresh="refresh">
            <home-search></home-search>
            <home-list :list="newsList"></home-list>
        </home-refresh>
    </div>
</template>

<script>
import HomeRefresh from '../components/Refresh/Index'
import HomeSearch from '../components/Search/Index'
import HomeList from '../components/Home/Index'
export default {
    name: 'PageHome',
    components: {
        HomeRefresh,
        HomeSearch,
        HomeList
    },
    data() {
        return {
        }
    },
    methods: {
        refresh(done) {
            var newsObj = {
                type: 'news',
                fromId: this.$store.state.userInfo.id,
                token: this.$store.state.userInfo.token
            }
            var newsData = JSON.stringify(newsObj);
            this.ws.send(newsData);
            setTimeout(() => {
                done()
            },500)
        }
    },
    computed: {
        newsList() {
            return this.$store.state.newsList
        }
    }
}
</script>

<style lang="scss" scoped>
.page-home{
    padding-top:56px;
    width:100vw;
    height:100vh;
}
</style>